﻿<%@ Application Language="C#" %>
<script RunAt="server">

    void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        try
        {
            Setting.Online = 0;
            Setting.Visited = 0;
            Setting.Today = 0;
            Application["FCKeditor:UserFilesPath"] = "../../../../../upload/news/";
        }
        catch { }
    }

    void Application_End(object sender, EventArgs e)
    {
        //  Code that runs on application shutdown

    }

    void Application_Error(object sender, EventArgs e)
    {
        // Code that runs when an unhandled error occurs

    }

    void Session_Start(object sender, EventArgs e)
    {
        Session.Add("Hit", true);
        Setting.PathCron = Server.MapPath("~/upload/xml/crawler.xml");
        Setting.refresh();
        Setting.PathCron = Server.MapPath(ConfigurationManager.AppSettings["sitemapPath"].ToString());
        ScheduleAction.runSchedule();
        ScheduleAction.addJob();
    }

    void Session_End(object sender, EventArgs e)
    {
        Application.Lock();
        Setting.Online = Setting.Online - 1;
        Application.UnLock();
    }
    void Application_BeginRequest(object sender, EventArgs e)
    {

    }
</script>
